Video images in an information stream can be transmitted to a user via a broadband communication network, for instance, over a satellite, cable, or terrestrial transmission medium. Efficient transmission of video requires compression and formatting techniques to be utilized, for instance, due to bandwidth limitations. Various protocols, such as MPEG protocols, have been designed to maximize bandwidth utilization for video information transmission by adding a temporal component to a spatial compression algorithm.
Each individual image or picture in a sequence of images or pictures of video can be referred to as a frame or field. Each picture or frame is made up of a large number of picture elements (pixels) that define the image. Within each picture or frame, redundant pixels describe like parts of a scene, e.g. a blue sky. Various types of compression algorithms have been used to remove redundant spatial elements thereby decreasing the bandwidth requirements for image transmission. For example, sequences of frames of video may contain pixels that are very similar or identical. Thus, to maximize bandwidth utilization, compression and motion compensation protocols, such as MPEG, can be used to minimize the redundant pixels between adjacent frames.
ITU-T H.264/MPEG-4 part 10 provides an example of an International video coding standard. ITU-T H.264/MPEG-4 part 10 is often referred to as MPEG-4 AVC (Advanced Video Coding). MPEG-4 AVC achieves data compression by utilizing coding tools, such as, spatial and temporal prediction, blocks of variable sizes, multiple references, integer transform blended with quantization operation, and entropy coding. MPEG-4 AVC supports adaptive frame and field coding at picture level and is able to encode pictures at relatively low bit rates yet maintains a desired quality of picture, or video quality.
Rate control is used to dynamically adjust encoding parameters so that the resulting compressed bit rate can meet a target bit rate. Rate control is important to regulate the encoded bit stream to satisfy the channel condition and to enhance the reconstructed video quality. In MPEG digital video systems, the complexity of a video frame or picture is measured by the product of the quantization level used to encode the frame or picture and the number of bits used for coding the frame or picture. This means the complexity of a frame or picture is not known until it has been encoded. As a result, the complexity information always lags behind the actual encoding process, which requires the buffering of a number of frames prior to encoding.
For a constant bit rate (CBR) MPEG video encoder, quantization is used as a means for adjusting the number of bits in a coded picture and buffer management is used as a means for providing a constant bit rate stream under conditions of widely varying number of bits per coded picture while trying to maintain uniform quality in reconstructed (i.e., decoded) video. Thus, issues with respect to scene change, buffer management, and quantizer selection are required to be addressed by the video encoder and its rate control algorithm.
With respect to scene changes, identifying a scene change at a cut and managing an abrupt change in video coding that may occur at a scene change boundary provide challenges and can impact video quality. At a scene change cut, the video quality experienced during the “old” (i.e., previous) scene should not noticeably degrade going into the cut. In addition, the video quality of the new scene immediately following the cut should be the same as the “steady state” video quality for the scene as a whole. The above referenced requirements should be met whether transitioning from an easy to encode (i.e., low complexity) scene to a hard to encode (i.e., high complexity) scene, transitioning from a hard to encode (i.e., high complexity) scene to an easy to encode (i.e., low complexity) scene, or transitioning between comparable scenes (with respect to coding efficiency) that may code significantly different.
With respect to buffer management, coded pictures vary greatly in size, and each video encoding standard must specify a buffer model for constant bit rate output from the encoder. For example, the H.264/MPEG-4 standard requires a coded picture buffer (CPB) of a hypothetical reference decoder (HRD); while, the H.262/MPEG-2 standard requires a video buffer verifier (VBV). A video encoder must never violate the given buffer model. Here, the problem is to balance the need to avoid violating the model and yet still use the fullest possible extent of the buffer to ensure that video quality is maximized for a given bit rate.
With respect to quantizer selection, a video encoder must select an integer quantizer for each and every macroblock in every picture or image. The quantizer provides the primary bit rate control mechanism of the encoder. The higher the quantizer, the lower the number of coded picture bits, and the lower the quantizer, the higher the number of coded picture bits. Rate control algorithms of encoders must provide the ability to derive from a target number of bits for a picture, or a subset of a picture, the quantizer value that will lead the encoder to encode the video to the desired number of bits, or as close as possible to the desired number of bits. However, the range of available quantizers may be small, for instance, limited to 52 values between zero (0) and 51 for the H.264/MPEG-4 standard. Thus, a small change in selected quantizer value can result in a large change in number of bits coded.
The H.264/MPEG-4 standard is designed such that a quantizer value decrease of one (1) should lead to a bit increase of about 12%. However, in practice, the percent change can be quite variable and, when increasing or decreasing the quantizer value by greater than one (1), the percent bit change may not be accurately predicted because the percentages tend not to scale well. Accordingly, the ability to accurately predict the number of bits produced via use of a quantizer value can be difficult. An accurate prediction is a necessary condition for an effective solution to buffer management issues discussed above.
Accordingly, a dual-pass MPEG video encoder and rate control algorithm that are able to address video quality issues at scene changes and provide scene change detection that prevent encoder buffer overflows, yet avoid buffer underflows that might harm video quality, and that can be used for straight constant bit rate (CBR) encoding as well as piece-wise CBR encoding, such as in a statistical multiplexer (stat-mux) system, are needed.